Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trending_enabled and search_enabled params added #4674

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

NorkzYT
Copy link

@NorkzYT NorkzYT commented May 1, 2024

This pull request contains two new config parameters, trending_enabled and search_enabled.

These parameters allow administrators to selectively enable or disable the trending and search functionalities within their Invidious instance. This was done with the motive to provide greater control over the feature set exposed to users.

@NorkzYT
Copy link
Author

NorkzYT commented May 3, 2024

Code formatting issues will be fixed soon.

@unixfox
Copy link
Member

unixfox commented May 18, 2024

If we are going to allow every specific pages to be disabled, we might as well use an array for that like:

pages_enabled:
  trending: true
  popular: true
  search: true

@NorkzYT
Copy link
Author

NorkzYT commented May 18, 2024

@unixfox

Great suggestion. Do you recommend I implement it in this GitHub Pull Request or in a separate one?

@unixfox
Copy link
Member

unixfox commented May 18, 2024

Would prefer in this one but we would need to keep compatibility with existing popular_enabled parameter.

@NorkzYT
Copy link
Author

NorkzYT commented May 18, 2024

Understood, that works.

@unixfox
Copy link
Member

unixfox commented May 18, 2024

@SamantazFox advice on my comment please: #4674 (comment)

@SamantazFox
Copy link
Member

If we are going to allow every specific pages to be disabled, we might as well use an array for that like:

pages_enabled:
  trending: true
  popular: true
  search: true

Yes, I second that! However, it will be a breaking change (will go with the next major version release).

@NorkzYT Though, why do you want to disable search? For the trending feed, I can understand that you may not want random crap in your home page, but why search?

@NorkzYT
Copy link
Author

NorkzYT commented May 20, 2024

@SamantazFox

My plan is to enable Invidious admins to control which features are accessible to users. This is particularly important for families/my family with young children who prefer YouTube over YouTube Kids. I found that existing tools lacked the ability to give admins such granular control over user features, thus I decided to contribute to Invidious by developing these admin control features.

For instance, in my case, I want to restrict access for some users that only very young children use to only allow certain YouTube channels that are pre-approved and subscribed to their user account. By disabling features like search, trending, and popular, I can ensure that children only interact with videos from these subscribed channels and playlists, thereby preventing exposure to unsuitable and overage content.

Additionally, I propose adding a search bar specifically for subscriptions and playlists. This would allow users to quickly find videos within these predefined categories without the need to navigate through entire channels or playlists, thus saving time and ensuring a safer viewing experience.

I know that a tool called TubeArchivist has a search feature for videos that have already been downloaded. However, I am switching from TubeArchivist to Invidious because I no longer want to host 5TB of downloaded YouTube videos, especially as the library keeps growing.

@NorkzYT
Copy link
Author

NorkzYT commented Jun 12, 2024

I will start working on this to complete as soon as I can.

@NorkzYT
Copy link
Author

NorkzYT commented Jun 30, 2024

Complete. Someone please test as the only issue I know is the Invidious docker container becoming unhealthy if I specify pages_enabled in the environmental variables under INVIDIOUS_CONFIG: as shown below even though it works without issues in Invidious itself.

services:
  invidious:
    container_name: invidious
    hostname: invidious
    build:
      context: .
      dockerfile: docker/Dockerfile.arm64
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      # Please read the following file for a comprehensive list of all available
      # configuration options and their associated syntax:
      # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: kemal
          host: invidious-db
          port: 5432
        check_tables: true
        # external_port:
        # domain:
        # https_only: false
        # statistics_enabled: false
        hmac_key: "xxx"
        player_style: youtube
        save_player_pos: true
        registration_enabled: true
        pages_enabled:
          popular: false
          trending: false
          search: false
        captcha_enabled: false
        feed_menu: ["Subscriptions", "Playlists"]
        default_home: <none>
        related_videos: false
        admins: ["norkz"] # set your user name
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    networks:
      - proxy

@iBicha
Copy link
Contributor

iBicha commented Jul 1, 2024

Complete. Someone please test as the only issue I know is the Invidious docker container becoming unhealthy if I specify pages_enabled in the environmental variables under INVIDIOUS_CONFIG: as shown below even though it works without issues in Invidious itself.

The health check is hitting the trending endpoint

    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1

Which you have disabled, so it is natural for it to appear unhealthy

@NorkzYT
Copy link
Author

NorkzYT commented Jul 1, 2024

@iBicha

Ah, thank you for the explanation. Much appreciated. I went right by it and did not notice.

config/config.example.yml Outdated Show resolved Hide resolved
src/invidious/views/user/preferences.ecr Outdated Show resolved Hide resolved
@NorkzYT
Copy link
Author

NorkzYT commented Jul 1, 2024

@SamantazFox

Thank you for the info. Suggestions have been added and completed.

@SamantazFox SamantazFox added need-testing This feature needs to be deployed and tested to see if it's working, and doesn't break something breaking This PR contains a breaking change and requires a major release labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This PR contains a breaking change and requires a major release need-testing This feature needs to be deployed and tested to see if it's working, and doesn't break something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants